package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-08-13
**/
@Entity
@Data
@Table(name="sy_weix_token")
public class SyWeixToken implements Serializable {
    /**
    * 
    */
    @ApiModelProperty(value = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 应用类型
    */
    @ApiModelProperty(value = "应用类型")
    @Column(name = "`type`",nullable = false)
    @NotBlank
    private String type;
    /**
    * 到期时间
    */
    @ApiModelProperty(value = "到期时间")
    @Column(name = "`time`",nullable = false)
    @NotNull
    private Timestamp time;
    /**
    * 当前有效token
    */
    @ApiModelProperty(value = "当前有效token")
    @Column(name = "`token`")
    private String token;
    /**
    * 
    */
    @ApiModelProperty(value = "createTime")
    @Column(name = "`create_time`",nullable = false)
    @NotNull
    private Timestamp createTime;
    /**
    * 
    */
    @ApiModelProperty(value = "updateTime")
    @Column(name = "`update_time`",nullable = false)
    @NotNull
    private Timestamp updateTime;

    public void copy(SyWeixToken source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
